﻿using System;
using System.Windows.Controls;
using System.Windows.Navigation;
using EzDesk.DesktopClient.UtilityView.ViewContract;
using EzDesk.DesktopClient.UtilityView.ViewModel;
using EzDesk.Generic;
using EzDesk.MVVMBase;

namespace EzDesk.DesktopClient.UtilityView.View
{
    /// <summary>
    /// Interaction logic for NotificationItemView.xaml
    /// </summary>
    public partial class NotificationItemView : UserControl, INotificationItemView
    {
        public NotificationItemView()
        {
            this.InitializeComponent();
        }

        private void ContentControl_RequestNavigate(object sender, RequestNavigateEventArgs e)
        {
            //OnNavigate.ExecuteMethod(null, "http://localhost:2604/Test.aspx");
            OnNavigate.ExecuteMethod(null, e.Uri.AbsoluteUri);
        }

        #region IFeedItemView Members

        public event EventHandler<GenericEventArg<string>> OnNavigate;

        #endregion

        #region IView Members

        object IView.ViewModel
        {
            get { return DataContext; }
            set { DataContext = value; }
        }

        #endregion

        public INotificationItemViewModel ViewModel
        {
            get { return DataContext as INotificationItemViewModel; }
            set { DataContext = value; }
        }
    }
}